<template>
	<view>
		<u-popup :round="10" :show="show" :safeAreaInsetBottom="false" mode="center">
			<view class="loginoutPop">
				<view class="title">{{title}}</view>
				<view class="desc">{{desc}}</view>
				<view class="loginoutBtn">
					<view class="btn" @click="close">{{cancelText}}</view>
					<view class="btn confirm" @click="confirm">{{confirmText}}</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		name: "rf-alert",
		props: {
			show: {
				type: Boolean,
				required: true,
				default: false,
			},
			title: {
				type: String,
				required: true,
				default: ""
			},
			desc: {
				type: String,
				required: true,
				default: ""
			},
			cancelText: {
				type: String,
				required: true,
				default: "取消"
			},
			confirmText: {
				type: String,
				required: true,
				default: "确定"
			}
		},
		data() {
			return {
				confirmShow: false,
			};
		},
		watch: {
			show(val) {
				console.log("----=-=-=-=-");
				console.log(val);
			},

		},
		methods: {
			confirm() {
				this.$emit('confirm', true)
			},
			close() {
				this.$emit('close')
			}
		}
	}
</script>

<style lang="scss">
	.loginoutPop {
		width: 480rpx;
		height: 320rpx;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: space-around;
		font-size: 28rpx;
		z-index: 999;

		.title {
			font-size: 32rpx;
			font-weight: 600;
			margin-top: 20rpx;
		}

		.desc {
			color: #77798D;
			// margin: 20rpx auto 40rpx;
			margin: 10rpx 40rpx;
			text-align: center;
		}

		.loginoutBtn {
			display: flex;
			margin-bottom: 20rpx;

			.btn {
				width: 200rpx;
				height: 72rpx;
				color: #58C866;
				background: #FFFFFF;
				border-radius: 36rpx;
				border: 2rpx solid #58C866;
				text-align: center;
				line-height: 72rpx;
				margin: 0 10rpx;
			}

			.confirm {
				background-color: #58C866;
				color: #fff;
			}
		}
	}
</style>